import { LocationQueryValue } from 'vue-router'
import request from '@/request'

// 登录
export const loginApi = (data: any):Promise<BasicAPIRes> => request.post('/index/login', data)
// 短信验证码
export const sendSmsApi = (data: any):Promise<BasicAPIRes> => request.post('/sendSms', data)
// 获取七牛上传token
export const getqiniuTokenApi = ():Promise<BasicAPIRes> => request.get('/getUploadToken')
// 计算距离
export const getDistanceApi = (data: any):Promise<BasicAPIRes> => request.post('/getDistance', data)
// 获取用户信息
export const getUserInfoApi = ():Promise<BasicAPIRes> => request.get('/index/getUserInfo')
// 获取banner
export const getBannerApi = ():Promise<BasicAPIRes> => request.get('/index/banner/list')
// 项目列表
export const productListAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/product/list', data)
// 项目详情
export const productDetailAPIRes = (data: { id: LocationQueryValue | LocationQueryValue[] }):Promise<BasicAPIRes> => request.post('/index/product/detail', data)
// 申请加入技师
export const joinTechAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/tech/apply', data)
// 收藏技师
export const collectTechAPIRes = (data: { id: any }):Promise<BasicAPIRes> => request.post('/index/tech/collect', data)
// 收藏技师列表
export const collectTechListAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/collect/tech/list', data)
// 技师列表
export const techListAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/tech/list', data)
// 技师详情
export const techDetailAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/tech/detail', data)
// 订单列表
export const orderListAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/order/list', data)
// 订单详情
export const orderDetailAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/order/detail', data)
// 下单
export const placeOrderAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/placeOrder', data)
// 创建订单
export const orderAddAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/order/add', data)
// 修改订单项目
export const orderEditAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/order/edit', data)
// 加钟
export const orderAddClockAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/order/addClock', data)
// 取消订单
export const orderCanceAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/order/cance', data)
// 删除订单
export const orderDelAPIRes = (orderNo: string):Promise<BasicAPIRes> => request.delete(`/index/order/del?orderNo=${orderNo}`)
// 订单服务完成
export const orderFinishAPIRes = (data: { orderNo: any }):Promise<BasicAPIRes> => request.post('/index/order/finish', data)
// 地址列表
export const addressListAPIRes = (data?: { isDefault: number } | undefined):Promise<BasicAPIRes> => request.post('/index/address/list', data)
// 地址详情
export const addressDetailAPIRes = (data: { id: number }):Promise<BasicAPIRes> => request.post('/index/address/detail', data)
// 新增地址
export const addressAddAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/address/add', data)
// 修改地址
export const addressEditAPIRes = (data: any):Promise<BasicAPIRes> => request.put('/index/address/edit', data)
// 删除地址
export const addressDeleteAPIRes = (id: number):Promise<BasicAPIRes> => request.delete(`/index/address/delete?id=${id}`)
// 优惠劵列表
export const couponListAPIRes = (data: any):Promise<BasicAPIRes> => request.post('/index/coupon', data)